﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using SingleUserMall.Orders.VO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static SingleUserMall.Dividends.Dividend;
using static SingleUserMall.Items.Item;

namespace SingleUserMall.Items.VO
{
    /// <summary>
    /// 商品详情
    /// </summary>
    [AutoMapFrom(typeof(Item))]
    public class ItemAppVO : EntityDto<long>
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 标签（,分隔）
        /// </summary>
        public string Tags { get; set; }
        /// <summary>
        /// 规格集合，价格对照（最低价格在前）
        /// </summary>
        public IReadOnlyList<ItemSpecVO> ItemSpecs { get; set; }
        /// <summary>
        /// sku集合，分类展示并用来选择
        /// </summary>
        public IReadOnlyList<ItemSkuCategoryVO> ItemSkuCategories { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal Freight { get; set; }
        /// <summary>
        /// 包装费
        /// </summary>
        public decimal PackPrice { get; set; }

        /// <summary>
        /// 商品详情
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 月销量
        /// </summary>
        public int MonthSale { get; set; }
        /// <summary>
        /// 总销量
        /// </summary>
        public int TotalSale { get; set; }

        /// <summary>
        /// 发货地
        /// </summary>
        public string Shipments { get; set; }
        /// <summary>
        /// 商品图片（以,分割）
        /// </summary>
        public string Pictures { get; set; }
        /// <summary>
        /// 团购标识
        /// </summary>
        public bool IsGroup { get; set; }
        /// <summary>
        /// 团购人数
        /// </summary>
        public int GroupCount { get; set; }
        /// <summary>
        /// 团购订单（优先显示最近5条）
        /// </summary>
        public IReadOnlyList<GroupOrderMiniVO> GroupOrders { get; set; }
        /// <summary>
        /// 发起的砍价（优先显示最近20条）
        /// </summary>
        public IReadOnlyList<BargainVO> BarginItems { get; set; }
        /// <summary>
        /// 是否收藏
        /// </summary>
        public bool IsFavorite { get; set; }
        /// <summary>
        /// 星级（根据评论计算得出）
        /// </summary>
        public double Star { get; set; }
        /// <summary>
        /// 最低原价（根据规格设定）
        /// </summary>
        public decimal OriginalPrice { get; set; }
        /// <summary>
        /// 最低价格（根据规格设定）
        /// </summary>
        public decimal Price { get; set; }
        /// <summary>
        /// 会员价格（根据规格设定）
        /// </summary>
        public decimal VipPrice { get; set; }
        /// <summary>
        /// 团购价格（根据规格设定）
        /// </summary>
        public decimal GroupPrice { get; set; }
        /// <summary>
        /// 限时购价格（根据规格设定）
        /// </summary>
        public decimal LimitPrice { get; set; }
        /// <summary>
        /// 限时购标识
        /// </summary>
        public bool IsTimeLimit { get; set; }
        /// <summary>
        /// 限时购开始时间
        /// </summary>
        public DateTime? LimitBeginTime { get; set; }
        /// <summary>
        /// 限时购结束时间
        /// </summary>
        public DateTime? LimitEndTime { get; set; }
        /// <summary>
        /// 其他说明
        /// </summary>
        public string Discription { get; set; }
        /// <summary>
        /// 保持零售价标识
        /// </summary>
        public bool IsKeepPrice { get; set; }
        /// <summary>
        /// 店铺id
        /// </summary>
        public int StoreId { get; set; }

        /// <summary>
        /// 砍价开始时间
        /// </summary>
        public DateTime? BargainStartTime { get; set; }

        /// <summary>
        /// 砍价结束时间
        /// </summary>
        public DateTime? BargainEndTime { get; set; }
        /// <summary>
        /// 砍价底价
        /// </summary>
        public decimal BargainPrice { get; set; }
        /// <summary>
        /// 需砍价次数
        /// </summary>
        public int BargainTimes { get; set; }
        /// <summary>
        /// 是否砍价
        /// </summary>
        public bool IsBargain { get; set; }
        /// <summary>
        /// 是否开始砍价
        /// </summary>
        public bool IsStartBargin { get; set; }
        /// <summary>
        /// 已达到的砍价价格
        /// </summary>
        public decimal ActualBargainPrice { get; set; }
        /// <summary>
        /// 已砍价格
        /// </summary>
        public decimal? ReducedPrice { get; set; }

        /// <summary>
        /// 果树总数量
        /// </summary>
        public int? TreeTotalQty { get; set; }

        /// <summary>
        /// 果树剩余数量
        /// </summary>
        public int? TreeRemainingQty { get; set; }
        /// <summary>
        /// 分红期数
        /// </summary>
        public int? NumberPeriods { get; set; }

        /// <summary>
        /// 期限（月）
        /// </summary>
        public int? Timelimit { get; set; }

        /// <summary>
        /// 分红比例
        /// </summary>
        public decimal? DividendAmount { get; set; }

        /// <summary>
        /// 分红比例显示界面
        /// </summary>
        public string DividendAmountView { get; set; }
        /// <summary>
        /// 分红比例显示界面 年分红
        /// </summary>
        public string DividendAmountViewByYear { get; set; }
        /// <summary>
        /// 分红类型
        /// </summary>
        public DividendType? DividendTypes { get; set; }

        /// <summary>
        /// 分红商品状态 0：未开始分红，1：分红中 ，2：分红完成
        /// </summary>
        public DividendStatus? DividendItemStatus { get; set; }
        /// <summary>
        /// 保底水果公斤数
        /// </summary>
        public int LatestFruitAmount { get; set; }
        /// <summary>
        /// 保底水果名称
        /// </summary>
        public string LatestFruitName { get; set; }
        /// <summary>
        /// 对应果树所在地址
        /// </summary>
        public string TreeAddress { get; set; }
        /// <summary>
        /// 对应最小果树号
        /// </summary>
        public string MinTreeNumber { get; set; }
        /// <summary>
        /// 对应最大果树号
        /// </summary>
        public string MaxTreeNumber { get; set; }
        /// <summary>
        /// 对应果树颗数
        /// </summary>
        public int TreeCount { get; set; }
        /// <summary>
        /// 果树成熟时间
        /// </summary>
        public DateTime? FruitFinishTime { get; set; }
        /// <summary>
        /// 果树剩余颗数
        /// </summary>
        public int LeftTreeCount { get; set; }
        /// <summary>
        /// 购买获得体验金
        /// </summary>
        public decimal Points { get; set; }
        /// <summary>
        /// 是否已售完
        /// </summary>
        public bool IsSaleOut { get; set; }
    }
}
